package com.qiaotongtianxia.loans.util;

import android.content.Context;
import android.graphics.Color;
import android.widget.TextView;
import android.widget.Toast;

import com.qiaotongtianxia.loans.R;


public class ToastUtil {
    private static Toast toast;

    public static void showShort(Context context, String content){
        if (toast == null) {
            toast = Toast.makeText(context.getApplicationContext(),content, Toast.LENGTH_SHORT);
            toast.setDuration(Toast.LENGTH_SHORT);
//            toast.setMsgGravity(Gravity.CENTER,0,0);
            TextView tv = (TextView) toast.getView().findViewById(android.R.id.message);
            tv.setTextColor(Color.WHITE);
            toast.getView().setBackgroundResource(R.drawable.border_solid_black);

        } else {
            toast.setText(content);
        }
        toast.show();
    }
}
